{include file="index/header" /}
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong class="icon-reorder"> 内容列表</strong></div>
  <div class="padding border-bottom">  
    <form method="post" action="" id="listform">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="{:url('add')}"> 添加讲师</a> </li>
        <li>搜索：</li>
        <li>
          <input type="text" placeholder="请输入搜索关键字" name="name" class="input" style="width:250px; line-height:17px;display:inline-block" value="{$param.name}" />
          <a href="javascript:void(0)" class="button border-main icon-search" onclick="changesearch()" > 搜索</a></li>
      </ul>
    </form>
  </div>
  
  <table class="table table-hover text-center">
    <tr>
      <th>ID</th>
      <th>名字</th>
      <th>职位</th>
      <th>logo</th>
      <th>操作</th>
    </tr>
    {foreach name='data' item='v'}
    <tr>
      <td><input type="checkbox" name="id[]" value="{$v.id}" />{$v.id}</td> 
      <td>{$v.name}</td>
      <td>{$v.duties}</td>
      <td><img src="{$v.logo}" width="100" height="100"></td>
      <td><div class="button-group">
	      <a class="button border-main" href="{:url('edit',['id' => $v['id']])}"><span class="icon-edit"></span> 修改</a>
	      <a class="button border-red" href="{:url('delete',['id' => $v['id']])}" onclick="if(confirm('确定删除?')==false)return false;"><span class="icon-trash-o"></span> 删除</a>
      </div></td>
    </tr>
    {/foreach}
    <tr>
    <td colspan="5">{$page}</td>
  </tr>
  </table>
  <input type="hidden" name="status" value="">
  
</div>
</body></html>
<script>
  //全选
$("#checkall").click(function(){ 
  $("input[name='id[]']").each(function(){
    if (this.checked) {
      this.checked = false;
    }
    else {
      this.checked = true;
    }
  });
});


function changesearch(){
    $("#listform").submit();    //提交ID为myform的表单
}

</script>